﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class StayController
    {
        public int InsertStay(StayInfo info)
        {
            return SQL.InsertStay(info.PriceId, info.OnDate, info.OffDate,info.RoomQuantity, info.TotalPrice, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status, info.ScheduleId);
        }
        public void UpdateStay(StayInfo info)
        {
            SQL.UpdateStay(info.StayId, info.PriceId, info.OnDate, info.OffDate, info.RoomQuantity, info.TotalPrice, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status,info.ScheduleId);
        }
        public void DeleteStay(StayInfo info)
        {
            DeleteStay(info.StayId);
        }
        public void DeleteStay(int stayId)
        {
            SQL.DeleteStay(stayId);
        }
        public StayInfo GetStay(int stayId)
        {
            return CBO.FillObject<StayInfo>(SQL.GetStay(stayId));
        }
        public List<StayInfo> ListStay()
        {
            return CBO.FillCollection<StayInfo>(SQL.ListStay());
        }
        public DataTable SelectStay()
        {
            return CBO.ConvertToDataTable(ListStay(), typeof(StayInfo));
        }

        public List<StayInfo> ListStayByIds(string stayIds)
        {
            return CBO.FillCollection<StayInfo>(SQL.ListStayByIds(stayIds));
        }
    }
}
